﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NF_Tools
{
    public partial class BF_List : UserControl
    {
        [Browsable(true), Category("自定义属性"), Description("Text")]
        public string QueryText
        {
            get { return label1.Text; }
            set { label1.Text = value; }
        }

        public BF_List()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 绘制边框和填充
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tableLayoutPanel1_Paint(object sender, PaintEventArgs e)
        {
            using (Pen p = new Pen(ColorTranslator.FromHtml("#CBD8F2"), 2))
            {
                Rectangle rec = new Rectangle(0, 0, this.Height - 1, this.Height - 1);
                e.Graphics.DrawArc(p, rec, 90, 180);//绘制左半边弧形
                Rectangle rec1 = new Rectangle(this.Width - this.Height - 1, 0, this.Height - 1, this.Height - 1);
                e.Graphics.DrawArc(p, rec1, 270, 180);//绘制右半边弧形

                e.Graphics.DrawLine(p, new Point(this.Height / 2, 1), new Point(this.Width - this.Height / 2, 1));
                e.Graphics.DrawLine(p, new Point(this.Height / 2, this.Height - 1), new Point(this.Width - this.Height / 2, this.Height - 1));
            }
        }

        /// <summary>
        /// 删除该标签
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void picSuche_Click(object sender, EventArgs e)
        {
            if (this.Parent != null)
                this.Parent.Controls.Remove(this);
        }
    }
}
